package a.f.n;

import a.c.a;
import a.c.e;
import a.c.m;
import a.c.q;
import a.c.x;
import a.f.c.c;
import a.f.cb;
import a.f.*;
import a.f.o;

import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;

import a.f.n.w;
import a.f.n.s;
import a.f.n.ab;
import a.f.n.r;

public class g
  extends mb
{
  public static final int w = 0;
  public static final int x = 1;
  public static final int y = 2;
  public static final int z = 0;
  public static final int A = 1;
  static final double B = 0.3D;
  static final double C = 0.5D;
  public static final byte D = 0;
  public static final byte E = 1;
  public static final byte F = 2;
  public static final byte G = 3;
  public static final byte H = 4;
  public static final byte I = 5;
  private byte J = 5;
  private Comparator K = new kb();
  private int L;
  private int M;
  private boolean N = true;
  private boolean O = true;
  private double P = 20.0D;
  private double Q = 40.0D;
  private boolean R;
  private boolean S;
  private double T = 0.3D;
  private double U = 0.5D;
  private k.b_ V = k.b_.a;
  public static int W;
  
  public g()
  {
    if (!bool) {}
    d(!this.N);
    vc localvc = g();
    if ((bool) || ((localvc instanceof c))) {
      ((c)localvc).a(false);
    }
    cb localcb = new cb();
    localcb.a(false);
    j(localcb);
  }
  
  public boolean b(o paramo)
  {
    return d.a(paramo, u());
  }
  
  public boolean a()
  {
    return this.O;
  }
  
  public void h(boolean paramBoolean)
  {
    this.O = paramBoolean;
  }
  
  public byte s()
  {
    return this.J;
  }
  
  public void b(byte paramByte)
  {
    if (!k.n) {}
    switch (paramByte)
    {
    case 0: 
    case 1: 
    case 2: 
    case 3: 
    case 4: 
    case 5: 
      this.J = paramByte;
      if (!k.m) {
        break;
      }
    default: 
      throw new IllegalArgumentException("Invalid policy: " + paramByte);
    }
  }
  
  private byte t()
  {
    if (!k.n) {
      if (x() == 0) {
        return 3;
      }
    }
    return 1;
  }
  
  public boolean u()
  {
    return this.N;
  }
  
  public void i(boolean paramBoolean)
  {
    this.N = paramBoolean;
    if (!k.n) {}
    d(!paramBoolean);
  }
  
  public void a(o paramo)
  {
    boolean bool = k.n;
    if (!bool)
    {
      if (!b(paramo)) {
        throw new a("Graph is not a tree");
      }
      if (bool) {}
    }
    else if (e(paramo))
    {
      h(paramo);
      if (bool) {
        break label58;
      }
      if (!k.m) {
        return;
      }
    }
    g(paramo);
    label58:
    new a.f.hb().doLayout(paramo);
  }
  
  private boolean e(o paramo)
  {
    boolean bool = k.n;
    if ((bool) || (this.V == k.b_.a))
    {
      if (bool) {
        break label177;
      }
      if (!this.R)
      {
        if (bool) {
          break label177;
        }
        if (!this.S)
        {
          if (bool) {
            break label177;
          }
          if (!f(paramo))
          {
            if (bool) {
              break label177;
            }
            if (this.U == 0.5D) {
              if (!bool)
              {
                if (this.M == 1)
                {
                  if (bool) {
                    break label177;
                  }
                  if (this.T != 0.3D) {}
                }
                else
                {
                  if (bool) {
                    break label177;
                  }
                }
              }
              else if (this.J != 3)
              {
                if (bool) {
                  break label177;
                }
                if (this.J != 1)
                {
                  if (bool) {
                    break label177;
                  }
                  if (this.J != 2)
                  {
                    if (bool) {
                      break label177;
                    }
                    if (this.J != 0) {
                      if (!bool)
                      {
                        if (this.J == 5)
                        {
                          if (bool) {
                            break label177;
                          }
                          if (!this.O) {
                            break label176;
                          }
                        }
                        if (bool) {
                          break label177;
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    label176:
    label177:
    return this.J == 4;
  }
  
  private boolean f(o paramo)
  {
    boolean bool = k.n;
    if (((bool) || (u())) && ((bool) || (h.b(paramo)))) {
      if (bool) {}
    }
    return !h.c(paramo);
  }
  
  private void g(o paramo)
  {
    f localf = new f();
    localf.a(v());
    localf.b(x());
    localf.b(z());
    localf.a(y());
    localf.a(w());
    localf.a(paramo);
  }
  
  private void h(o paramo)
  {
    boolean bool3 = k.n;
    boolean bool2 = k.m;
    x localx1 = paramo.B();
    paramo.a(d.w, localx1);
    x localx2 = paramo.B();
    paramo.a(d.y, localx2);
    x localx3 = paramo.B();
    paramo.a(d.x, localx3);
    r localr1 = new r(this.V, this.V);
    localr1.c(this.Q);
    localr1.a(this.P);
    localr1.a(this.M);
    localr1.d(this.T);
    localr1.b(this.U);
    if (!bool3) {
      if (!this.S) {
        if (bool3) {
          break label140;
        }
      }
    }
    label140:
    localr1.b(this.R);
    j localj1 = new j();
    localj1.a((byte)0);
    localj1.b((byte)3);
    localj1.a(this.Q);
    localj1.f(this.P);
    localj1.c(t());
    j localj2 = new j((byte)0, (byte)2, (byte)1, 20.0D, 80.0D);
    localj2.a((byte)1);
    localj2.b((byte)7);
    localj2.c((byte)2);
    localj2.a(this.Q);
    localj2.f(this.Q);
    j localj3 = new j((byte)0, (byte)2, (byte)1, 20.0D, 80.0D);
    localj3.a((byte)3);
    localj3.b((byte)7);
    localj3.c((byte)2);
    localj3.a(this.Q);
    localj3.f(this.Q);
    s locals = new s();
    locals.a(false);
    locals.b(this.Q * 0.5D);
    locals.c(this.Q);
    r localr2 = new r(this.V, this.V);
    localr2.c(this.Q);
    localr2.a(this.P);
    localr2.a(this.M);
    localr2.d(this.T);
    localr2.b(this.U);
    if (!bool3) {
      if (!this.S) {
        if (bool3) {
          break label431;
        }
      }
    }
    label431:
    localr2.b(this.R);
    localr2.a(true);
    b_ localb_1 = null;
    int i = w();
    switch (i)
    {
    case 1: 
      localb_1 = new b_((byte)0, (byte)0);
      break;
    case 2: 
      localb_1 = new b_((byte)0, (byte)1);
    }
    Object localObject1;
    if (!a())
    {
      localObject1 = localj1;
      if (!bool2) {}
    }
    else
    {
      localObject1 = localr1;
    }
    a.c.ab localab = a.a.kb.i(paramo);
    HashMap localHashMap = new HashMap();
    int j = s();
    Object localObject2 = paramo.v();
    Object localObject3;
    label669:
    label871:
    label882:
    do
    {
      do
      {
        if (!((a.c.w)localObject2).e()) {
          break;
        }
        localObject3 = ((a.c.w)localObject2).d();
        if (bool2) {
          break label1018;
        }
        if (j == 5)
        {
          localx1.a(localObject3, localObject1);
          localx2.a(localObject3, this.K);
          if (bool3) {
            continue;
          }
          if (!bool2) {}
        }
        else
        {
          if (!bool3)
          {
            if (j != 1)
            {
              if (bool3) {
                break label669;
              }
              if (j != 2)
              {
                if (bool3) {
                  break label669;
                }
                if (j != 3)
                {
                  if (bool3) {
                    break label924;
                  }
                  if (j != 0) {
                    break label922;
                  }
                }
              }
            }
            if (bool3) {
              break label914;
            }
          }
          if (a((e)localObject3) > 1)
          {
            if (!bool3) {
              if (j == 1)
              {
                localx1.a(localObject3, localj2);
                if (bool3) {
                  break label882;
                }
                if (!bool2) {
                  break label871;
                }
              }
            }
            if (!bool3)
            {
              if (j == 2)
              {
                localx1.a(localObject3, localj3);
                if (bool3) {
                  break label882;
                }
                if (!bool2) {
                  break label871;
                }
              }
              if (bool3) {}
            }
            else if (j == 3)
            {
              if (!bool3)
              {
                if (a((e)localObject3) > 2)
                {
                  localx1.a(localObject3, locals);
                  if (bool3) {
                    break label882;
                  }
                  if (!bool2) {
                    break label871;
                  }
                }
                localx1.a(localObject3, localj3);
              }
              if (bool3) {
                break label882;
              }
              if (!bool2) {
                break label871;
              }
            }
            if (!bool3)
            {
              if (j == 0)
              {
                if ((bool3) || (a((e)localObject3) > 2)) {
                  if (!bool3)
                  {
                    if (a((e)localObject3, localHashMap)) {
                      localx1.a(localObject3, locals);
                    }
                  }
                  else
                  {
                    if (bool3) {
                      break label882;
                    }
                    if (!bool2) {
                      break label871;
                    }
                  }
                }
                localx1.a(localObject3, localj3);
              }
              localx2.a(localObject3, null);
            }
            if (bool3) {
              continue;
            }
            if (!bool2) {}
          }
          else
          {
            localx1.a(localObject3, localObject1);
            localx2.a(localObject3, this.K);
            if (bool3) {
              continue;
            }
            if (bool2)
            {
              if (!bool3)
              {
                if (j == 4)
                {
                  localx1.a(localObject3, localr2);
                  localx2.a(localObject3, this.K);
                }
              }
              else
              {
                if (bool3) {
                  continue;
                }
                if (!bool2) {
                  break label987;
                }
              }
              localx1.a(localObject3, localObject1);
              localx2.a(localObject3, this.K);
            }
          }
        }
        localx3.a(localObject3, localb_1);
        ((a.c.w)localObject2).f();
      } while (!bool2);
    } while (bool3);
    label914:
    label922:
    label924:
    label987:
    if (2 != i)
    {
      label1018:
      if (1 != i) {}
    }
    else
    {
      localObject2 = new b_((byte)2, (byte)0);
      localObject3 = new b_((byte)1, (byte)0);
      b_ localb_2 = new b_((byte)3, (byte)0);
      b_ localb_3 = new b_((byte)0, (byte)2);
      b_ localb_4 = new b_((byte)0, (byte)3);
      if (!bool3) {}
      int k = 2 == i ? 1 : 0;
      a.c.w localw = paramo.v();
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale1 = localw.d();
        if (!bool3)
        {
          if (locale1.d() > 0)
          {
            a.c.d locald = locale1.i();
            e locale2 = locald.e();
            boolean bool1 = a(locald, paramo);
            Object localObject4 = localx1.get(locale2);
            if (!bool3)
            {
              if (localObject4 == localj3)
              {
                if (!bool3) {
                  if (!bool1) {
                    localx3.a(locale1, localObject2);
                  }
                }
                if (bool3) {
                  continue;
                }
                if (k == 0) {
                  break label1327;
                }
                localx3.a(locale2, localb_3);
                if (bool3) {
                  continue;
                }
                if (!bool2) {
                  break label1327;
                }
              }
              if (bool3) {}
            }
            else if (localObject4 == localj2)
            {
              if (bool3) {
                continue;
              }
              if (bool1) {
                break label1327;
              }
              localx3.a(locale1, localObject3);
              if (bool3) {
                continue;
              }
              if (!bool2) {
                break label1327;
              }
            }
            if (localObject4 == locals)
            {
              if (!bool3) {
                if (!bool1) {
                  localx3.a(locale1, localb_2);
                }
              }
              if (bool3) {
                continue;
              }
              if (k != 0) {
                localx3.a(locale2, localb_4);
              }
            }
          }
          localw.f();
        }
      } while (!bool2);
    }
    label1327:
    localObject2 = localab.l();
    do
    {
      while (!bool2)
      {
        if (!((m)localObject2).e()) {
          break;
        }
        paramo.e(((m)localObject2).a());
        ((m)localObject2).f();
      }
    } while (bool3);
    localObject2 = new c_(null);
    ((c_)localObject2).j(this.S);
    ((c_)localObject2).i(this.R);
    ((c_)localObject2).h(u());
    ((c_)localObject2).i(g());
    ((c_)localObject2).a(false);
    ((c_)localObject2).a(paramo);
    paramo.a(localx1);
    paramo.a(localx2);
    paramo.a(localx3);
    paramo.j(d.w);
    paramo.j(d.y);
    paramo.j(d.x);
  }
  
  private boolean a(a.c.d paramd, q paramq)
  {
    boolean bool = k.n;
    a.c.k localk = paramq.c(oc.a);
    if (!bool) {
      if (B())
      {
        if (bool) {
          break label43;
        }
        if (localk != null) {
          break label36;
        }
      }
    }
    return false;
    label36:
    label43:
    kc[] arrayOfkc = (kc[])localk.get(paramd);
    if ((bool) || (arrayOfkc != null)) {
      if (bool) {}
    }
    return arrayOfkc.length > 0;
  }
  
  private boolean a(e parame, Map paramMap)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (!bool2)
    {
      if (parame.d() > 1) {
        return false;
      }
      if (bool2) {}
    }
    else if (parame.d() == 0)
    {
      return true;
    }
    e locale1 = parame.i().e();
    int i = 0;
    if (!bool2)
    {
      if (paramMap.containsKey(locale1)) {
        i = ((Integer)paramMap.get(locale1)).intValue();
      }
    }
    else
    {
      if (bool2) {
        break label176;
      }
      if (!bool1) {
        break label172;
      }
    }
    a.c.w localw = locale1.q();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale2 = localw.d();
      if (bool1) {
        break label180;
      }
      if (a(locale2) > i) {
        i = locale2.e();
      }
      localw.f();
    } while (!bool1);
    if (!bool2)
    {
      paramMap.put(parame, new Integer(i));
      label172:
      label176:
      if (parame.e() > i / 2) {
        label180:
        return true;
      }
    }
    return false;
  }
  
  private int a(e parame)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    int i = 0;
    a.c.w localw = parame.q();
    if (localw.e()) {
      i++;
    }
    while (bool2)
    {
      e locale = localw.d();
      if (bool1) {
        break label69;
      }
      if (locale.e() > 0) {
        return -1;
      }
      localw.f();
      if (!bool1) {
        break;
      }
    }
    label69:
    return i;
  }
  
  public void a(Comparator paramComparator)
  {
    this.K = paramComparator;
  }
  
  public Comparator v()
  {
    return this.K;
  }
  
  public void a(int paramInt)
  {
    this.L = paramInt;
  }
  
  public int w()
  {
    return this.L;
  }
  
  public void b(int paramInt)
  {
    this.M = paramInt;
  }
  
  public int x()
  {
    return this.M;
  }
  
  public void a(double paramDouble)
  {
    this.P = paramDouble;
  }
  
  public double y()
  {
    return this.P;
  }
  
  public void b(double paramDouble)
  {
    this.Q = paramDouble;
  }
  
  public double z()
  {
    return this.Q;
  }
  
  public boolean A()
  {
    return this.R;
  }
  
  public void j(boolean paramBoolean)
  {
    this.R = paramBoolean;
    C();
  }
  
  public boolean B()
  {
    return this.S;
  }
  
  public void k(boolean paramBoolean)
  {
    this.S = paramBoolean;
    C();
  }
  
  private void C()
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    if (!bool2)
    {
      if (!this.S)
      {
        if (bool2) {
          break label122;
        }
        if (!this.R) {}
      }
      else
      {
        d(new pc());
      }
    }
    else
    {
      vc localvc = b();
      if (!bool2)
      {
        if ((localvc instanceof pc))
        {
          ((pc)localvc).g(this.S);
          ((pc)localvc).d(this.S);
          ((pc)localvc).f(this.R);
        }
      }
      else
      {
        if (bool2) {
          break label118;
        }
        if (!bool1) {
          break label108;
        }
      }
      throw new IllegalStateException("No LabelLayoutTranslator registered");
      label108:
      if (bool2) {
        break label123;
      }
      c(true);
      if (!bool1) {
        label118:
        return;
      }
    }
    label122:
    label123:
    c(false);
  }
  
  public double D()
  {
    return this.T;
  }
  
  public void c(double paramDouble)
  {
    this.T = paramDouble;
  }
  
  public double F()
  {
    return this.U;
  }
  
  public void d(double paramDouble)
  {
    this.U = paramDouble;
  }
  
  public void a(k.b_ paramb_)
  {
    this.V = paramb_;
  }
  
  public k.b_ G()
  {
    return this.V;
  }
  
  private static class b_
    implements hb
  {
    static final byte a = 0;
    static final byte b = 1;
    static final byte c = 2;
    static final byte d = 3;
    static final byte f = 0;
    static final byte g = 1;
    static final byte h = 2;
    static final byte i = 3;
    private final byte j;
    private final byte k;
    
    b_(byte paramByte1, byte paramByte2)
    {
      this.j = paramByte1;
      this.k = paramByte2;
    }
    
    public void a(o paramo, e parame)
    {
      boolean bool = k.n;
      a.c.k localk = paramo.c(d.w);
      gb localgb = (gb)localk.get(parame);
      k.b_ localb_ = k.b_.a;
      if ((bool) || ((localgb instanceof k))) {
        localb_ = ((k)localgb).b();
      }
      ab localab = new ab(localb_.a(), paramo.d(parame));
      if (!bool) {
        if (parame.d() > 0) {
          a(parame, paramo, localab);
        }
      }
      if (parame.e() > 0) {
        c(parame, paramo, localab);
      }
    }
    
    protected void a(e parame, o paramo, ab paramab)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      a.c.d locald1 = parame.i();
      int m = this.j;
      if (!bool2) {
        if (3 == m)
        {
          e locale = locald1.e();
          int n = 1;
          m localm = locale.n();
          do
          {
            do
            {
              if (!localm.e()) {
                break;
              }
              a.c.d locald2 = localm.a();
              if (bool1) {
                break label134;
              }
              if (locald2.f() == parame) {
                break;
              }
              if (!bool2) {}
              n = n == 0 ? 1 : 0;
              localm.f();
            } while (!bool1);
          } while (bool2);
          if (!bool2) {}
          label134:
          m = n != 0 ? 1 : 2;
        }
      }
      if (!bool2) {}
      switch (m)
      {
      case 1: 
        paramo.b(locald1, new a.d.w(paramab.d() * 0.5D, 0.0D));
        if (!bool2) {
          if (!bool1) {
            return;
          }
        }
      case 2: 
        if (!bool2)
        {
          paramo.b(locald1, new a.d.w(-paramab.d() * 0.5D, 0.0D));
          if (!bool1) {
            return;
          }
        }
        break;
      }
      paramo.b(locald1, new a.d.w(0.0D, -paramab.c() * 0.5D));
    }
    
    protected void c(e parame, o paramo, ab paramab)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      if (!bool2)
      {
        if (0 == this.k)
        {
          a.d.w localw = new a.d.w(0.0D, paramab.c() * 0.5D);
          m localm1 = parame.n();
          do
          {
            if (!localm1.e()) {
              break;
            }
            paramo.a(localm1.a(), localw);
            localm1.f();
          } while (!bool1);
        }
        if (bool2) {}
      }
      else if (3 == this.k)
      {
        m = parame.e();
        d1 = paramab.d();
        d2 = -d1 * 0.5D;
        d3 = d1 * 0.5D;
        d4 = d1 / (m + 1);
        double d5 = paramab.c() * 0.5D;
        int i1 = 0;
        m localm3 = parame.n();
        label259:
        do
        {
          if (!localm3.e()) {
            break;
          }
          if (!bool2) {
            if (i1 % 2 == 0)
            {
              i2 = i1 / 2 + 1;
              paramo.a(localm3.a(), new a.d.w(d2 + i2 * d4, d5));
              if (bool2) {
                continue;
              }
              if (!bool1) {
                break label259;
              }
            }
          }
          int i2 = (i1 + 1) / 2;
          paramo.a(localm3.a(), new a.d.w(d3 - i2 * d4, d5));
          i1++;
          localm3.f();
        } while (!bool1);
      }
      int m = parame.e();
      double d1 = paramab.d();
      double d2 = -d1 * 0.5D;
      double d3 = d1 / (m + 1);
      if (!bool2)
      {
        if (2 == this.k) {
          d2 *= -1.0D;
        }
      }
      else {
        d3 *= -1.0D;
      }
      double d4 = paramab.c() * 0.5D;
      int n = 1;
      m localm2 = parame.n();
      do
      {
        if (!localm2.e()) {
          break;
        }
        paramo.a(localm2.a(), new a.d.w(d2 + n * d3, d4));
        n++;
        localm2.f();
      } while (!bool1);
    }
  }
  
  private class c_
    extends d
  {
    private double Y = 2.0D;
    
    private c_() {}
    
    protected d.a_ i(e parame)
    {
      d.a_ locala_ = super.i(parame);
      if (g.this.S)
      {
        w localw = new w(parame, this.K);
        localw.a(locala_, (byte)0, this.Y, a());
      }
      return locala_;
    }
    
    protected d.a_ e(e parame)
    {
      if (!k.n) {
        if (g.this.S)
        {
          super.j(false);
          d.a_ locala_ = super.e(parame);
          super.j(true);
          return locala_;
        }
      }
      return super.e(parame);
    }
    
    c_(g.0 param0)
    {
      this();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.n.g

 * JD-Core Version:    0.7.0.1

 */